<%@ page language="java" import="com.gin.util.*" pageEncoding="UTF-8" %>
<%@ page language="java" import="java.util.*" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="ssm" uri="http://ssm" %>


<html>
<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script src="js/jquery.js"></script>
    <script src="js/jquery.validate.js"></script>
    <style type="text/css">
        <!--
        body {
            margin: 10px;
            background-repeat: repeat-x;
            background-color: #e6e2df;
        }
        -->
    </style>
</head>
<body>

<style>
    *{
        box-sizing: border-box;
    }
    .form-group:after
    {
        display: block;
        content: ' ';
        height: 0px;
        overflow: hidden;
        clear: both;
    }
    .form-group{
        padding-bottom: 5px;
        margin-bottom: 5px;
        border-bottom: 1px #494949 dashed;
    }
    .form-group .label{
        float: left;
        width: 100px;
        text-align: right;
    }
    .form-group .input{
        margin-left: 110px;
    }
    .form-group .input input{
        display: block;
        width: 95%;
        height: 30px;
        line-height: 30px;
        padding-left: 5px;
        padding-right: 5px;
    }
    .btns{
        display: inline-block;
        border: none;
        padding: 5px 10px;
        background: #0a6999;
        color: #ffffff;
        text-align: center;
    }
    .forget-title{
        text-align: center;
    }
</style>

<form action="forget.do" method="post" id="form1" name="form1">
    <h3 class="forget-title">
        密保找回密码
    </h3>
    <c:choose>
<c:when test="${errorMsg != null && errorMsg !=  '' }">

    <div class="error">
        ${errorMsg}
    </div>
    </c:when></c:choose>
    <c:choose>
<c:when test="${step == '1' }">

    <c:choose>
<c:when test="${param.cx == null || param.cx == '' }">

    <div class="form-group">
        <div class="label">
            用户类型
        </div>
        <div class="input">
            <select name="cx">
                                <option value="教师">教师</option>
                                <option value="学生">学生</option>
                            </select>
        </div>
    </div>
    </c:when><c:otherwise>
    <input type="hidden" name="cx" value="${param.cx}" />
    </c:otherwise></c:choose>
    <div class="form-group">
        <div class="label">
            用户名
        </div>
        <div class="input">
            <input type="text" required data-msg-required="请填写用户名" name="username" value="${param.username}" />
        </div>
    </div>
    <div class="form-group">
        <div class="label">
            &nbsp;
        </div>
        <div class="input">
            <button type="submit" class="btns">下一步</button>
        </div>
    </div>
    <input type="hidden" name="step" value="2">
    </c:when><c:when test="${step == '2' }">

    <div class="form-group">
        <div class="label">
            问题：
        </div>
        <div class="input">
            ${user.wenti}
        </div>
    </div>
    <div class="form-group">
        <div class="label">
            答案：
        </div>
        <div class="input">
            <input type="text" name="daan" required data-msg-required="请填写答案" value="" />
        </div>
    </div>
    <div class="form-group">
        <div class="label">
            &nbsp;
        </div>
        <div class="input">
            <button type="submit" class="btns">下一步</button>
        </div>
    </div>
    <input type="hidden" name="username" value="${param.username}">
    <input type="hidden" name="cx" value="${param.cx}">
    <input type="hidden" name="step" value="3">
    </c:when><c:when test="${step == '3' }">

    <div class="form-group">
        <div class="label">
            新密码：
        </div>
        <div class="input">
            <input type="password" required data-msg-required="请输入密码" name="xmm" id="xmm" value="" />
        </div>
    </div>
    <div class="form-group">
        <div class="label">
            确认密码：
        </div>
        <div class="input">
            <input type="password" equalTo="#xmm" name="xmm2" required data-msg-required="请在此输入密码" value="" />
        </div>
    </div>
    <div class="form-group">
        <div class="label">
            &nbsp;
        </div>
        <div class="input">
            <button type="submit" class="btns">修改密码</button>
        </div>
    </div>
    <input type="hidden" name="username" value="${param.username}" />
    <input type="hidden" name="cx" value="${param.cx}" />
    <input type="hidden" name="step" value="4" />
    <input type="hidden" name="daan" value="${param.daan}" />
    </c:when><c:otherwise>
    <div class="form-group">
        找回密码成功
    </div>
    </c:otherwise></c:choose>

</form>
<script>
    $('#form1').validate();
</script>


</body>
</html>
